import base64
import json

dic = {'name': 'AK', 'age': 18, 'sex': '男'}
dic_str = json.dumps(dic)

# 编码
ret = base64.b64encode(dic_str.encode('utf-8'))
print(ret)

# 解码

res = base64.b64decode(ret)
print(res)

print(base64.b64decode('6Lev54Gv57uP6L+H5LiA5aSc55qE5Yqq5Yqb77yM5omN5peg').decode('utf-8'))